package group2assignone.ucm.manager;

import group2assignone.model.Flight;
import group2assignone.ucm.UCController;
import group2assignone.view.manager.CreateFlightView;

/**
 * use case controller for updating gui when creating a flight
 * @author group2
 */
public class UCCreateFlightEdit implements UCController {

    private CreateFlightView flightView = new CreateFlightView();
    private Flight f = new Flight();

    /**
     * sets view and flight
     * @param fView
     * @param flight
     */
    public UCCreateFlightEdit(CreateFlightView fView, Flight flight) {
        flightView = fView;
        f = flight;
    }

    @Override
    public void run() {
        flightView.clearScreen();
        flightView.go();
        flightView.setText(f);
    }
}
